Skip to content

fix(calendar): classify self-organized imported events as editable via organizerCalendarAddress fallback#527

Open
krisatverbidio wants to merge 1 commit into
bulwarkmail:mainfrom
krisatverbidio:fix/calendar-organizer-check
Open

fix(calendar): classify self-organized imported events as editable via organizerCalendarAddress fallback#527
krisatverbidio wants to merge 1 commit into
bulwarkmail:mainfrom
krisatverbidio:fix/calendar-organizer-check

Conversation

@krisatverbidio

Copy link
Copy Markdown
Contributor

Summary

isOrganizer previously only recognized the current user as an event organizer when a participant carried the roles.owner flag. Self-organized events imported from other servers (e.g. Zimbra) using Vandelay don't set that flag - they convey the organizer at the event level via organizerCalendarAddress (or replyTo) instead. This PR adds a fallback so those events are correctly identified as organized by the user.

Changes

  • Added a getEventOrganizerEmails helper that collects event-level organizer addresses from organizerCalendarAddress and replyTo, stripping the mailto: prefix and normalizing to lowercase.
  • Reworked isOrganizer to check participant roles.owner first, then fall back to matching the event-level organizer address(es) against the user's emails.
  • Changed the early-return guard from !event.participants to userEmails.length === 0, so events with no participants can still match via the organizer-address fallback.
  • Added tests covering the organizerCalendarAddress match (including case-insensitivity), the replyTo fallback, and the negative case where the organizer is someone else.

Related Issues

Fixes #525

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactor / code quality improvement
  • Chore / dependency update / CI change

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style and conventions
  • I have run npm run typecheck && npm run lint and there are no errors
  • The build passes (npm run build)
  • I have tested my changes locally
  • I have added or updated documentation if needed
  • I have updated translations (locales/) if my changes affect user-facing text
  • I have included screenshots or a screen recording for UI changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Self-organized events render as external/respond-only: isOrganizer ignores event-level organizerCalendarAddress / replyTo

1 participant